<?php
// GET FEATURED PRODUCT ID #s FROM THE CUSTOM FIELDS
		$compareproductoneid = get_field('catcompareproductone', 'product_cat_'.$category_ID.'');
		$compareproducttwoid = get_field('catcompareproducttwo', 'product_cat_'.$category_ID.'');
?>
	
	<h2 class="pagesubsectionheader" style="text-align:center;padding:0px;margin:0px;margin-bottom:10px;">Find Your Perfect Solution</h2>
	<table class="comparetable" width="100%" cellpadding="0" cellspacing="0" border="0">
		<tr>
			<td>
				<!-- COMPARE PRODUCT ONE - GOOD PRODUCT -->
				<div class="categorycompareproduct categorycompareproductone" style="padding-bottom:0px;">
					
					<?php $compareproductone = new wp_Query('post_type=product&number_posts=1&p='.$compareproductoneid.''); ?>
					<?php while($compareproductone->have_posts()) : $compareproductone->the_post(); ?>
						<?php
							$productsku = get_post_custom($post->ID);
							$showsku = $productsku['_sku'];
								foreach ( $showsku as $showsku );
							if (get_field('productFeaturedImage') != '') {
								$productimageurl = get_field('productFeaturedImage');
							} else {
								$productimageurl = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ));
								$productimageurl = $productimageurl[0];
							}
						?>
					
                                                <div class="goodproductimage">
                                                    <a href="<?php the_permalink(); ?>"><img src="<?php echo $productimageurl; ?>" alt="<?php the_title(); ?>" /></a>
                                                </div>
						<p class="compareproductname"><a href="<?php the_permalink(); ?>"><?php the_titlesmall('', '...', true, '40'); ?></a></p>
						<?php include '/home/silicons/public_html/wp-content/themes/woostore/woocommerce/single-product/price.php'; ?>
						<p style="font-weight:bold;font-style:italic;color:#717470;">Features &amp; Benefits</p>
						<?php if (has_sub_field('compareproductatts')) { ?>
							<ul>
							<?php while(has_sub_field('compareproductatts')) : ?>
								<li><?php the_sub_field('compareproductatt'); ?></li>
							<?php endwhile; ?>
							</ul>
						<?php } ?>
						<p><a href="<?php the_permalink(); ?>" class="button">View Product Details</a></p>
						
					<?php endwhile; ?>
					<?php wp_reset_query(); ?>
				
				</div>
			</td>
                        <td>
				<div class="categorycompareleft" style="padding-bottom:0px;">
					<?php if (has_sub_field('compareproductatts', 'product_cat_'.$category_ID.'')) { ?>
						<ul>
							<?php while(has_sub_field('compareproductatts', 'product_cat_'.$category_ID.'')) : ?>
								<li><?php the_sub_field('compareproductatt', 'product_cat_'.$category_ID.''); ?></li>
							<?php endwhile; ?>
						</ul>
					<?php } ?>
				</div>
			</td>
			<td>
				<!-- COMPARE PRODUCT TWO -- BAD PRODUCT -->
				<div class="categorycompareproduct categorycompareproducttwo" style="padding-bottom:0px;">
					
					<?php $compareproducttwo = new wp_Query('post_type=product&p='.$compareproducttwoid.''); ?>
					<?php while($compareproducttwo->have_posts()) : $compareproducttwo->the_post(); ?>
						<?php
							$productsku = get_post_custom($post->ID);
							$showsku = $productsku['_sku'];
								foreach ( $showsku as $showsku );
							if (get_field('productFeaturedImage') != '') {
								$productimageurl = get_field('productFeaturedImage');
							} else {
								$productimageurl = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ));
								$productimageurl = $productimageurl[0];
							}
						?>
					
						<a href="<?php the_permalink(); ?>"><img src="<?php echo $productimageurl; ?>" alt="<?php the_title(); ?>" /></a>
						<p class="compareproductname"><a href="<?php the_permalink(); ?>"><?php the_titlesmall('', '...', true, '40'); ?></a></p>
						<?php include '/home/silicons/public_html/wp-content/themes/woostore/woocommerce/single-product/price.php'; ?>
						<p style="font-weight:bold;font-style:italic;color:#717470;">Features &amp; Benefits</p>
						<?php if (has_sub_field('compareproductatts')) { ?>
							<ul>
							<?php while(has_sub_field('compareproductatts')) : ?>
								<li><?php the_sub_field('compareproductatt'); ?></li>
							<?php endwhile; ?>
							</ul>
						<?php } ?>
						<p><a href="<?php the_permalink(); ?>" class="button">View Product Details</a></p>
						
					<?php endwhile; ?>
					<?php wp_reset_query(); ?>
					
				</div>
			</td>
		</tr>
	</table>